using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using SCSEngine.ResourceManagement;
using SCSEngine.Sprite;
using SCSEngine.ScreenManagement;
using SVLvsXNA;
using SVLvsXNA.TriUanGame;

namespace TriUan.TriUanGame.GameScreen.Modes
{
    public class FreeStyleMode : IMode
    {
        private static FreeStyleMode inst;
        private IResourceManager resourceManager;

        private FreeStyleMode(GamePage gamePage)
        {
            resourceManager = (IResourceManager)gamePage.Services.GetService(typeof(IResourceManager));
        }

        public static FreeStyleMode getInst(GamePage gamePage)
        {
            if (inst == null)
            {
                inst = new FreeStyleMode(gamePage);
            }
            return inst;
        }

        public void Change(GameModeScreen gameMode, IGameScreenManager manager)
        {
            gameMode.Background = resourceManager.GetResource<Texture2D>("GameMode_2");
            gameMode.icon = resourceManager.GetResource<ISprite>("ScareCrow_FreeStyle");
            gameMode.iconPosition = new Vector2(60f, 295f);
            gameMode.iconScale = 0.5f;

            gameMode.ButtonLeft.Background = resourceManager.GetResource<ISprite>(Language.Prep + "PAINT");
            gameMode.ButtonLeft.Size = new Vector2(97f, 26f);
            gameMode.ButtonLeft.Visible = true;
            gameMode.ButtonLeft.Enabled = true;
            gameMode.ButtonRight.Background = resourceManager.GetResource<ISprite>(Language.Prep + "Shake");
            gameMode.ButtonRight.Size = new Vector2(109, 26f);
            gameMode.ButtonRight.Visible = true;
            gameMode.ButtonRight.Enabled = true;

            gameMode.Classic.Visible = false;
            gameMode.Classic.Enabled = false;

            gameMode.Creative.Visible = false;
            gameMode.Creative.Enabled = false;

            gameMode.FreeStyle.Visible = false;
            gameMode.FreeStyle.Enabled = false;
        }
    }
}
